import { toSuccess, useRedis } from "@sker/core"


export default async () => {
    await useRedis(7, async r => {
        const rooms = await r.keys('rooms*')
        if (rooms && rooms.length > 0) {
            await Promise.all(rooms.map(async room => {
                const isTtl = await r.ttl(room)
                if(isTtl === -1) await r.del(room)
            }))
        }
    })
    return toSuccess(true)
}
